local dx_queue = require("dx_queue")
local log = require("mylog")

local start_service = {}

function start_service.running_status(ret)
    config.configStrToTable()
    local status = g_config["run_status"]
    local topic = "20220316/event/alarm" .. "####"
    local msg = ""
    -- 启动状态（0：重置，1：正常，2：升级，3：看门狗）
    if not ret then
        if status == 0 then
        elseif status == 1 then
        elseif status == 2 then
            msg = "type@!@5@#@value@!@" .. 1
            dx_queue.push(mqtt_queue, topic .. msg, 500)
        elseif status == 3 then
            msg = "type@!@6@#@value@!@" .. 1
            dx_queue.push(mqtt_queue, topic .. msg, 500)
        end
    end
    -- 临时改默认值为看门狗重启
    g_config["run_status"] = 3
    local ret = writecfg()
    if ret ~= 0 then
        log.debug("[running_status]启动状态保存失败！")
    end
    config.configTableToStr()
end

return start_service
